package com.letoken.platform.app.team;

import com.letoken.platform.repo.app.dao.AppUserMapper;
import com.letoken.platform.repo.app.dao.AppUserTeamMapper;
import com.letoken.platform.repo.app.dao.AppUserTeamPathMapper;
import com.letoken.platform.repo.app.po.AppUser;
import com.letoken.platform.repo.app.po.AppUserTeam;
import com.letoken.platform.repo.app.po.AppUserTeamPath;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author wyl
 * @Description TODO
 * @date 2023/1/10 20:27
 * @Version 1.0
 */
@SpringBootTest
public class AppUserTeamTest111 {

    @Autowired
    private AppUserMapper appUserMapper;

    @Autowired
    private AppUserTeamMapper appUserTeamMapper;
    
    @Autowired
    private AppUserTeamPathMapper appUserTeamPathMapper;

    @Test
    public void aa(){
//
//        List<AppUser> appUserList = appUserMapper.selectList(null);
//        for (AppUser appUser : appUserList) {
//            Integer userId = appUser.getId();
//            if (appUserTeamMapper.selectById(userId) == null){
//                LocalDateTime now = LocalDateTime.now();
//                AppUserTeam appUserTeam = new AppUserTeam();
//                appUserTeam.setUserId(userId);
//                appUserTeam.setEcoLevel(0);
//                appUserTeam.setEcoValue(BigDecimal.ZERO);
//                appUserTeam.setUserValue(BigDecimal.ZERO);
//                appUserTeam.setTeamMember(0);
//                appUserTeam.setTeamValue(0);
//                appUserTeam.setUserAchievement(0);
//                appUserTeam.setInviterId(0);
//                appUserTeam.setCreateTime(now);
//                appUserTeam.setUpdateTime(now);
//                appUserTeam.setTeamSumValue(0);
//                appUserTeam.insert();
//            }
//
//            if (appUserTeamPathMapper.selectById(userId) == null){
//                AppUserTeamPath appUserTeamPath = new AppUserTeamPath();
//                appUserTeamPath.setUserId(userId);
//                appUserTeamPath.setInvitePath("");
//                appUserTeamPath.insert();
//            }
//
//        }
    }
}
